#include <func.h>

int global=10;
void* pthread_func(void* p)
{
     global=5;
     printf("i am child thread global=%d\n",global);
}
int main()
{
    pthread_t pthid;
    int ret=pthread_create(&pthid,NULL,pthread_func,NULL);
    if(ret!=0)
    {
        printf("pthread_func failed %s\n",strerror(ret));
        return -1;
    }
    sleep(1);
    printf("i am main thread global=%d\n",global);
    return 0;
}